Safe Parallel Programming in an Interpreted Language
نویسندگان
چکیده
Parallel programming is increasingly important with the advent of multicore processors. However, modern software is difficult to parallelize because of the high degree of modularization. It is unclear whether a piece of code is parallel if it calls other functions. Dynamic languages such as Ruby, Python, and Matlab represent modularization to the extreme. A program, also known as a script, requires interpretation for every statement, calling a whole host of functions from parsing to execution. Because of the complexity of the interpreter and the dynamic nature of script code, scripting languages are among the most difficult to parallelize. In this paper, safe parallelization means to parallelize a sequential program with the guarantee that the parallelized version produces the same result as the original sequential code. In other words, safety means sequential equivalence. There are generally three ways to ensure safety. Consider a sequential loop as the target program to parallelize. The first way is static. A compiler analyzes the loop and determines whether it is parallel. Static parallelization means that the loop is parallel in all executions. The second way is dynamic. Immediately before executing the loop, a run-time library determines whether the loop is parallel. The third way is speculative. The loop is run in parallel speculatively. If conflicts are detected in the parallel execution, the conflicting part is rolled back and re-run sequentially. This paper uses the third way and describes a system that speculatively parallelizes a Ruby script to ensure safety. In the past, most speculation systems were for automatic parallelization and were not user programmable [2, 5, 10]. Then a number of interfaces appeared, including safe future in Java [13], ordered transactions using TLS hardware [12], and possibly parallel region (PPR) in the BOP (behaviorbased parallelization) system [4, 6, 14], and multi-threaded transactions [9]. These are effectively hints of parallelism. Dependence hints were introduced in the BOP system as a way to suggest possible dependences between operations in different PPRs [7]. In this paper, we adapt the BOP interfaces for use in Ruby. 2. Safe Parallel Ruby
منابع مشابه
Cloud Computing Technology Algorithms Capabilities in Managing and Processing Big Data in Business Organizations: MapReduce, Hadoop, Parallel Programming
The objective of this study is to verify the importance of the capabilities of cloud computing services in managing and analyzing big data in business organizations because the rapid development in the use of information technology in general and network technology in particular, has led to the trend of many organizations to make their applications available for use via electronic platforms hos...
متن کاملALua: An Event-Driven Communication Mechanism for Parallel and Distributed Programming
This paper presents ALua, an event-driven communication mechanism based on the interpreted language Lua. This mechanism takes advantage of the interpreted nature of Lua to deene messages as chunks of code which are executed by the receiver. The event-driven distributed programming model is discussed and demonstrated with a set of examples. Applicability of ALua in real-sized parallel applicatio...
متن کاملAmorphous Infrastructure for Language Implementation
We propose a method for the robust implementation of simple graphical automata on an amorphous computer. This infrastructure is applied to the implementation of purely functional programming languages. Specifically, it is used in conjunction with data-flow techniques to implement a toy language homologous to recurrence equations, exploiting control-flow parallelism through parallel operand eval...
متن کاملGlint: Breeding Mobile Ambients with Object Orientation
Software Engineering is facing a crisis. Hardware designers are no longer able to make ever faster single-threaded CPUs and are instead building CPUs with thread-level parallelism. Simultaneously, clusters of computers are becoming far more popular for building high performance systems but making good use of these parallel and distributed systems is difficult to achieve with current tools. Mobi...
متن کاملExploiting Implicit Parallelism in Dynamic Array Programming
We have built an interpreter for the array programming language J. The interpreter exploits implicit data parallelism in the language to achieve good parallel speedups on a variety of benchmark applications. Many array programming languages operate on entire arrays without the need to write loops. Writing without loops simplifies the programs. Array programs without loops allow an interpreter t...
متن کامل